using WineCellar.Web.Controllers;

namespace WineCellar.Web.Controllers
{
    public abstract class MessageControllerBase : ApplicationController
    {
        private PropertyAccessorBase _propertyAccessor;

        public MessageControllerBase(PropertyAccessorBase propertyAccessor)
        {
            this._propertyAccessor = propertyAccessor;
        }
        protected override void Initialize()
        {
            base.Initialize();
            this._propertyAccessor.Initialize(this);
        }
        public PropertyAccessorBase PropertyAccessor
        {
            get { return this._propertyAccessor; }
        }
    }
    public abstract class MessageControllerBase<TPropertyAccessor> : MessageControllerBase
        where TPropertyAccessor : PropertyAccessorBase,new()
    {
        private TPropertyAccessor _propertyAccessor;
        public MessageControllerBase():base(new TPropertyAccessor())
        {
            
            this._propertyAccessor = (TPropertyAccessor)base.PropertyAccessor;
        }


        public new TPropertyAccessor PropertyAccessor
        {
            get { return this._propertyAccessor; }
        }
        
    }
   

}
